/**
 * Created by 王健 on 2018/6/6.
 */

$(function () {
    //GetQueryString('sessionid')
    var html_data = {
        baseConfig: baseConfig,
        sessionid: '',
        sessionid_q: '',
        address_info:{},
        change_host_username:'',
        host_user:{},
        user:{},
        wechatuser_server:{},
        wechatuser_app:null,
        province_list:[],
        city_list:[],
        county_list:[],
        address_list: []

    };
    var app = new Vue({
        el: '#bind_host_by_wechat',
        data: html_data,
        methods: {
            change_user:function () {
                apis.sys.change_user({username:html_data.change_host_username}).then(function (data) {
                    Magiclamp.mcAlert("提示", data.message, "好的", function () {

                    });
                })
            }
        }
    });
    html_data.sessionid = GetQueryString('sessionid');
    if (html_data.sessionid) {
        html_data.sessionid_q = "sessionid=" + html_data.sessionid;
        client_storage('sessionid', html_data.sessionid);
    }
    html_data.change_host_username = GetQueryString('username');


    login_mogu(function () {
        apis.sys.get_userinfo_by_username({username:html_data.change_host_username}).then(function (data) {
            html_data.host_user = data.result.host_user;
            html_data.user = data.result.user;
            html_data.wechatuser_server = data.result.wechatuser_server;
            html_data.wechatuser_app = data.result.wechatuser_app;
        })

    }, "home", null, true);
});